package org.xukai.common.util;

import java.io.File;

/**
 * @author xukai
 * @desc
 * @date 2016-12-16-下午 4:56
 */
public class UrlUtil {

    public static String checkUrlEnd(String url) {
        if(null != url && !"".equals(url)) {
            if(!url.endsWith("/") && !url.endsWith(File.separator)) {
                url = url + "/";
            }
        } else {
            url = "";
        }

        return url.replaceAll("[\\\\]", "/");
    }

    public static String checkUrl(String url) {
        return null != url && !"".equals(url)?url.replaceAll("[\\\\]", "/"):"";
    }
}
